<div ng-controller="AppController">
    <div class="page-header">
        <h1>清单</h1>
    </div>
    <div class="alert alert-info" role="alert" ng-hide="items &amp;&amp; items.length > 0">
        还没有项目.
    </div>
    <form class="form-horizontal" role="form" ng-submit="addItem(newItem)">
        <div class="form-group" ng-repeat="item in items">
            <div class="checkbox col-xs-9">
                <label>
                    <input type="checkbox" ng-model="item.checked" ng-change="updateItem(item)"/>
                    <p><span ng-bind="item.description"></span></p>
                </label>
            </div>
            <div class="col-xs-3">
                <button class="pull-right btn btn-danger" type="button" title="Delete"
                        ng-click="deleteItem(item)">
                    <span class="glyphicon glyphicon-trash"></span>
                </button>
            </div>
        </div>
        <hr/>
        <div class="input-group">
            <input type="text" class="form-control" ng-model="newItem" placeholder="输入描述..."/>
          <span class="input-group-btn">
            <button class="btn btn-default" type="submit" ng-disabled="!newItem" title="Add">
                <span class="glyphicon glyphicon-plus"></span>
            </button>
          </span>
        </div>
    </form>
</div>